﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using SLIITPro.Core;

namespace SLIITPro.Data.Extension
{
    public class CellIdExtension
    {
        private Datamanager _datamanager;
        public CellIdExtension()
        {
            _datamanager = new Datamanager();
        }
        public DataRow GetLatLang(int cellId, int lac, int mnc, int mcc)
        {
            var query = Properties.Resources.GetLatLng;
            SqlParameter[] param = new SqlParameter[4];
            param[0] = new SqlParameter("@1", SqlDbType.Int) { Value = cellId };
            param[1] = new SqlParameter("@2", SqlDbType.Int) { Value = mcc };
            param[2] = new SqlParameter("@3", SqlDbType.Int) { Value = mnc };
            param[3] = new SqlParameter("@4", SqlDbType.Int) { Value = lac };
            var tablerow = _datamanager.ExecuteQuery(query, "Cell_Info", param).Rows[0];
            return tablerow;
        }
    }
}
